<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../JS/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {
            var $div = $('#div01');
            var $div02 = $('#div02');
            var $li = $('li');

            var iLen = $div.length;
            var iLen02 = $li.length;
            var iLen03 = $div02.length;

            alert(iLen);
            alert(iLen02);

            // 没有选择元素 属性值为0
            alert(iLen03);
        })
    </script>
</head>
<body>
    <div id="div01"></div>
    <ul>
        <li>wdnmd</li>
        <li>wdnmd</li>
        <li>wdnmd</li>
        <li>wdnmd</li>
        <li>wdnmd</li>
        <li>wdnmd</li>
        <li>wdnmd</li>
        <li>wdnmd</li>
    </ul>
</body>
</html>